package com.gqz.patrol.app.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * @ClassName EnWzJfglEntity
 * @Description 机房信息表
 */


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "T_EN_WZ_JFGL", schema = "BS_EQUIP")
public class EnWzJfglEntity implements Serializable {

    /**
     * 机房名称
     */
    @TableField(value = "JF_NAME")
    private String jfName;

    /**
     * 运维单位编码
     */
    @TableField(value = "YWDWBM")
    private String ywdwbm;

    /**
     * 地址
     */
    @TableField(value = "ADDRESS")
    private String address;

    /**
     * 创建人
     */
    @TableField(value = "CREATE_PEOPLE")
    private String createPeople;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "createTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 运维单位名称
     */
    @TableId
    private String id;

    /**
     * null
     */
    @TableField(value = "YWDWMC")
    private String ywdwmc;

    /**
     * 是否删除 0否1是
     */
    @TableField(value = "IS_DEL")
    private String isDel;

    /**
     * 启用/禁用编码
     */
    @TableField(value = "STATUS")
    private String status;

    /**
     * 启用/禁用
     */
    @TableField(value = "STATUSNAME")
    private String statusname;

    private static Map<String, SFunction<EnWzJfglEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("jfName", EnWzJfglEntity::getJfName);
        map.put("ywdwbm", EnWzJfglEntity::getYwdwbm);
        map.put("address", EnWzJfglEntity::getAddress);
        map.put("createPeople", EnWzJfglEntity::getCreatePeople);
        map.put("createTime", EnWzJfglEntity::getCreateTime);
        map.put("id", EnWzJfglEntity::getId);
        map.put("ywdwmc", EnWzJfglEntity::getYwdwmc);
        map.put("isDel", EnWzJfglEntity::getIsDel);
        map.put("status", EnWzJfglEntity::getStatus);
        map.put("statusname", EnWzJfglEntity::getStatusname);

    }

    public static SFunction<EnWzJfglEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }

}
